//
//  InformationViewCell.m
//  ForestPack
//
//  Created by 骆锴 on 2018/7/24.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "InformationViewCell.h"
#import "PaperBoardDetialModel.h"

@interface InformationViewCell()

@property(nonatomic, strong) NSMutableArray *labelvalue;
@property(nonatomic, strong) UILabel *industry_des;
@property(nonatomic, strong) UILabel *scope_des;
@property(nonatomic, strong) UILabel *foctory;

@end

@implementation InformationViewCell

+ (InformationViewCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellID = @"TitleInformationCell";
    InformationViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[InformationViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.backgroundColor = [UIColor whiteColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell createSubView];
    }
    
    return cell;
}


-(void)createSubView{
    
    UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(0), ScreenX375(0), ScreenX375(SCREEN_WIDTH), ScreenX375(1))];
    UIColor *color = REXADECIMALCOLOR(@"#dcdcdc");
    [line setBackgroundColor:color];
    [self addSubview:line];
    
    NSArray *imgx = [[NSArray alloc] initWithObjects:@"15",@"138",@"248", nil];
    _labelvalue = [[NSMutableArray alloc] initWithObjects:@"推荐行业22:全行业",@"台州范围内包邮",@"发货厂区:大溪森林", nil];
    for (int i = 0; i < imgx.count; i++) {
        UIImageView *select = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenX375([[imgx objectAtIndex:i] integerValue]), ScreenX375(16), ScreenX375(5), ScreenX375(5))];
        select.image = [UIImage imageNamed:@"选择"];
        [self addSubview: select];
    }
    
    _industry_des =[[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(27), ScreenX375(13), ScreenX375(100), ScreenX375(12))];
    _industry_des.text = @"111";
    _industry_des.font = Kfont(12);
    _industry_des.textColor = REXADECIMALCOLOR(@"#333333");
    _industry_des.textAlignment = NSTextAlignmentLeft;
    [self addSubview:_industry_des];
    
    _scope_des =[[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(150), ScreenX375(13), ScreenX375(100), ScreenX375(12))];
    _scope_des.text = @"111";
    _scope_des.font = Kfont(12);
    _scope_des.textColor = REXADECIMALCOLOR(@"#333333");
    _scope_des.textAlignment = NSTextAlignmentLeft;
    [self addSubview:_scope_des];
    
    _foctory =[[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(260), ScreenX375(13), ScreenX375(130), ScreenX375(12))];
    _foctory.text = @"111";
    _foctory.font = Kfont(12);
    _foctory.textColor = REXADECIMALCOLOR(@"#333333");
    _foctory.textAlignment = NSTextAlignmentLeft;
    [self addSubview:_foctory];
}

- (void)initWithModel:(PaperBoardDetialModel *)model{
    NSString *a = [[NSString alloc] initWithFormat:@"推荐行业:%@",model.industry_des];
    NSString *b = [[NSString alloc] initWithFormat:@"%@范围内包邮",model.scope_des];
    NSString *c = [[NSString alloc] initWithFormat:@"发货厂区:%@",kNSUDefaultReadKey(@"Factory")];
    _industry_des.text = a;
    _scope_des.text = b;
    _foctory.text = c;
}


@end
